@highlight-color: #007aff;

.x-tree_mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s;
}

.x-tree_mask.tree-show {
  visibility: visible;
  opacity: 1;
}

.x-tree_container {
  position: fixed;
  top: 20%;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  transition: all 0.3s;
  transform: translateY(100%);
  border-radius: 20rpx 20rpx 0 0;
  display: flex;
  flex-direction: column;
}

.x-tree_container.tree-show {
  transform: translateY(0);
}

.x-tree_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  margin: 10rpx;

  .x-tree_btn {
    padding: 10rpx 20rpx;
  }

  .x-tree_cancel-btn {
    color: @highlight-color;
  }

  .x-tree_confirm-btn {
    color: @highlight-color;
  }

  .x-tree_clear-btn {
    color: @highlight-color;
  }

  .x-tree_title {
    color: #5e6d82;
  }

  .x-tree_v-divider {
    width: 1rpx;
    height: 1em;
    margin: 0 10rpx;
    background-color: #5e6d82;
  }
}

.x-tree_top-search {
  margin: 10rpx 20rpx;
  padding: 5rpx 10rpx;
  border: 1rpx solid #e5e5e5;
  border-radius: 10rpx;
  height: 50rpx;
  .x-tree_search-input {
    height: 100%;
    padding: 5rpx;
    box-sizing: border-box;
    font-size: 14px;
  }
}

.x-tree_content {
  flex: 1;
  overflow: hidden;
}

.x-tree_list {
  height: 100%;
}

.x-tree_item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10rpx 20rpx 10rpx 10rpx; // right 设置大点，因为选中符号在右侧，靠边缘太近，视觉上不好，操作上也不好
  opacity: 0;
  transition: all 0.3s;
  height: 0;
  box-sizing: border-box;
}

.x-tree_item + .x-tree_item {
  border-top: 1rpx solid #e5e5e5;
}

.x-tree_item-show {
  opacity: 1;
  height: auto;
}

.x-tree_item-hide {
  opacity: 0;
  height: 0;
  display: none;
}

.x-tree_item-icon {
  position: relative;
}

.x-tree_item-name {
  font-size: 14px;
  padding: 10rpx 10rpx;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  .x-tree_item-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.x-tree_item-btn {
  // background-color: #5e6d82;

  .x-tree_item-radio,
  .x-tree_item-checkbox {
    width: 100%;
    height: 100%;
    border: 1rpx solid @highlight-color;

    box-sizing: border-box;
    position: relative;
    transition: all 0.1s;
  }

  .x-tree_item-radio {
    border-radius: 50%;
  }

  .x-tree_item-checkbox-checked,
  .x-tree_item-radio-checked {
    background-color: @highlight-color;
  }

  .x-tree_item-checkbox-checked::after,
  .x-tree_item-radio-checked::after {
    position: absolute;
    content: " ";
    width: 25%;
    height: 50%;
    border-right: 1rpx solid white; /*用border 做个假的对号*/
    border-bottom: 1rpx solid white;
    left: 50%;
    top: 50%;
    transform: translate(-35%, -70%) rotate(45deg); /*调整视觉效果到居中的感觉*/
  }

  .x-tree_item-checkbox {
    border-radius: 2rpx;
  }

  @indeterminate-size: 2rpx;

  .x-tree_item-checkbox-indeterminate {
    background-color: @highlight-color;

    &::after {
      content: " ";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 80%;
      height: @indeterminate-size;
      background-color: #fff;
      transform: translate(-50%, -50%);
    }
  }
}

@iconSize: 30rpx;

.x-tree_item-icon,
.x-tree_item-btn {
  width: @iconSize;
  height: @iconSize;
}

.x-tree_item-btn {
  padding: 5rpx 15rpx;
}

// 默认都有，但最后一级没有
.x-tree_item-icon::after {
  content: " ";
  position: absolute;
  transition: all 0.3s;
}

.x-tree_item-icon-arrow::after {
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-top: @iconSize / 2 solid transparent;
  border-bottom: @iconSize / 2 solid transparent;
  border-left: @iconSize / 2 solid @highlight-color; /* 三角形的颜色 */
}

.x-tree_item-icon-arrow-show::after {
  transform: translateX(-50%) rotate(90deg);
}

@dot-size: 10rpx;
.x-tree_item-icon-last-dot::after {
  width: @dot-size;
  height: @dot-size;
  border-radius: 100%;
  background-color: @highlight-color;
  box-sizing: border-box;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
